export default{
	props:{
			house : { type: Object, default: undefined } ,
		},
		emits:['openurl'],
		data(){
			return {
				 
			}
		}, 
		computed :{
			//首付支付情况
			firstpay(){
				if(this.house.firstpay) {
					return this.house.firstpay
				}
				if( this.house.bill){
					return this.house.billpay + '万 首付比例('+this.house.bill+ '%),咨询详情'
				}
				return '首付及贷款情况请咨询经纪人';
			},
			//收藏
			favorite_is_checked(){
				return this.house.isfavorite ? true : false;
			}
		},
		methods:{
			openurl(e){
				console.log(e)
				this.$emit('openurl', e)
			},
				
			openTallk(e){
				uni.navigateTo({
					url: "/pages/tallk/tallk?bid="+ this.house.broker.id + "&hid="+this.house.id
				})
			},
			openVillage(e){
				uni.navigateTo({
					url: "/pages/show/village?id="+ this.house.village_id
				})
			},
			onFavorite(e){
				
				this.kbutil.getModuleData("favorite/add",{
					id: this.house.id, 
					smalltext:"",
					iscancel: this.house.isfavorite ? 1: 0,
				}).then( ret => {
					this.house.isfavorite = !this.house.isfavorite;
				}).catch(e=>{
					this.house.isfavorite = !this.house.isfavorite;
				})
			}
		}
	 
}